Learning Kotlin Programming
Kotlin has 4 ways to access the collection element!
You have [ ]
, get
, elementAt
, and componentN
. Which one to use?
Published in
4 min readMay 10, 2020
If you’ve had to use Kotlin Collection, you probably have access to its element before. How do you do it? Which one do you use below?
val value = myCollection[0]